<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .content{
      height:2000px;
      padding-top:300px;
      margin-top:100px;
    }
    .content>div{
      height:100px;
      width:100px;
      background:red;
    }
    .fixed{
      position:fixed;
      left:0;
      top:0
    }
    .sticky{
      position:sticky;
      left:500px;
      top:0
    }
  </style>
</head>
<body>
  <div class="content">
    <div class='fixed'></div>
    <div class='sticky'></div>
  </div>
</body>
</html>